package edu.usc.csci578.algorithm;

import java.util.HashSet;
import java.util.Set;

import edu.usc.csci578.model.Cluster;


public class Solution implements Comparable<Solution>
{
	public Set<Cluster> solution; 
	
	public Solution()
	{
		solution = new HashSet<Cluster> ();
	}
	
	public void add(Cluster cluster)
	{
		solution.add(cluster);
	}
	
	public void remove(Cluster cluster)
	{
		solution.remove(cluster);
	}
	
	public int compareTo(Solution another)
	{
		if(this.solution.size()!=another.solution.size())
			return (this.solution.size()>another.solution.size()?1:-1);
		
		for(Cluster element: this.solution)
			if(!another.solution.contains(element))
				return 1;
		return 0;
	}
}
